﻿using Microsoft.AspNetCore.Http;
using Simple.Repository.Models.ClassRoom;
using Simple.Repository.Models.Slideshow;

namespace Simple.Services;

public class SlideshowCreateOrUpdateModel : ModelBase
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public Guid? Id { get; set; } = null;

    /// <summary>
    /// 标题
    /// </summary>
    [Required(ErrorMessage ="请填写标题！")]
    public string Title { get; set; } = "";

    /// <summary>
    /// 来源 1-内部，2-外部
    /// </summary>
    [Required(ErrorMessage = "请选择来源！")]
    public int Source { get; set; }

    /// <summary>
    /// 来源1-内部(文章-1或课程-2类别)
    /// </summary>
    public int? SourceType { get; set; } = null;

    /// <summary>
    ///2-外部(http地址)
    /// </summary>
    public string? HttpURL { get; set; } = "";

    /// <summary>
    /// 1-内部（文章Id或课程Id）
    /// </summary>
    public Guid? ObjectId { get; set; } = null;

    /// <summary>
    /// 排序
    /// </summary>
    public int? SortValue { get; set; } = 0;

    /// <summary>
    /// 是否可见
    /// </summary>
    public bool? IsShow { get; set; } = true;

    /// <summary>
    /// 显示区域1-家长，2-园务
    /// </summary>
    public string? ShowRange { get; set; } = "";

    /// <summary>
    /// 图片
    /// </summary>
    public IFormFile? ImageFile { get; set; } = null;

    public override void ConfigureMapper(Profile profile)
    {
        profile.CreateMap<SlideshowManage, SlideshowCreateOrUpdateModel>();

        profile.CreateMap<SlideshowCreateOrUpdateModel, SlideshowManage>();
    }
}
